#include "stdafx.h"
#include "ckEnumCheckProject.h"
#include "ckCheckProject.h"

namespace ck
{

	EnumCheckProject::EnumCheckProject()
	{
		m_iter = m_projects.begin();
	}


	EnumCheckProject::~EnumCheckProject()
	{
		Cleanup();
	}

	void EnumCheckProject::Add(CheckProject* pProject)
	{
		if (pProject)
		{
			m_projects.push_back(pProject);
		}
	}

	void EnumCheckProject::Cleanup()
	{
		std::vector<CheckProject*>::iterator iter;
		for (iter = m_projects.begin(); iter != m_projects.end(); iter++)
		{
			(*iter)->Release();
		}
		m_projects.clear();
	}

	void EnumCheckProject::Reset()
	{
		m_iter = m_projects.begin();
	}

	CheckProject* EnumCheckProject::Next()
	{
		if (m_iter == m_projects.end())
		{
			return NULL;
		}
		return *(m_iter++);
	}

}
